package com.gykj.tap.service;

import com.serotonin.modbus4j.exception.ModbusInitException;
import com.serotonin.modbus4j.exception.ModbusTransportException;

/**
 * 写数据
 * 设置单个线圈,写 [01 Coil Status(0x)]写一个 function ID = 5
 * @author rohto
 *
 */
public interface IWriteSingleCoilService {
	/**
	 * 写 [01 Coil Status(0x)]写一个 function ID = 5
	 * 
	 * @param slaveId slave的ID
	 * @param writeOffset 位置
	 * @param writeValue 值
	 * @param host TODO
	 * @param port TODO
	 * @return 是否写入成功
	 * @throws ModbusTransportException
	 * @throws ModbusInitException
	 */
	public boolean writeCoil(int slaveId, int writeOffset, boolean writeValue, String host, int port) throws ModbusTransportException, ModbusInitException;
}
